3.136 \(\int \cos ^2(a+b x) \cot ^2(a+b x) \, dx\)

Optimal. Leaf size=40 \[ -\frac{3 \cot (a+b x)}{2 b}+\frac{\cos ^2(a+b x) \cot (a+b x)}{2 b}-\frac{3 x}{2} \]

[Out]

(-3*x)/2 - (3*Cot[a + b*x])/(2*b) + (Cos[a + b*x]^2*Cot[a + b*x])/(2*b)

________________________________________________________________________________________

Rubi [A]  time = 0.0367128, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.235, Rules used = {2591, 288, 321, 203} \[ -\frac{3 \cot (a+b x)}{2 b}+\frac{\cos ^2(a+b x) \cot (a+b x)}{2 b}-\frac{3 x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x]^2*Cot[a + b*x]^2,x]

[Out]

(-3*x)/2 - (3*Cot[a + b*x])/(2*b) + (Cos[a + b*x]^2*Cot[a + b*x])/(2*b)

Rule 2591

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> With[{ff = FreeFactors[Ta
n[e + f*x], x]}, Dist[(b*ff)/f, Subst[Int[(ff*x)^(m + n)/(b^2 + ff^2*x^2)^(m/2 + 1), x], x, (b*Tan[e + f*x])/f
f], x]] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2]

Rule 288

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^
n)^(p + 1))/(b*n*(p + 1)), x] - Dist[(c^n*(m - n + 1))/(b*n*(p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, x]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cos ^2(a+b x) \cot ^2(a+b x) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^2\right )^2} \, dx,x,\cot (a+b x)\right )}{b}\\ &=\frac{\cos ^2(a+b x) \cot (a+b x)}{2 b}-\frac{3 \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\cot (a+b x)\right )}{2 b}\\ &=-\frac{3 \cot (a+b x)}{2 b}+\frac{\cos ^2(a+b x) \cot (a+b x)}{2 b}+\frac{3 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\cot (a+b x)\right )}{2 b}\\ &=-\frac{3 x}{2}-\frac{3 \cot (a+b x)}{2 b}+\frac{\cos ^2(a+b x) \cot (a+b x)}{2 b}\\ \end{align*}

Mathematica [A]  time = 0.134405, size = 31, normalized size = 0.78 \[ -\frac{6 (a+b x)+\sin (2 (a+b x))+4 \cot (a+b x)}{4 b} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*x]^2*Cot[a + b*x]^2,x]

[Out]

-(6*(a + b*x) + 4*Cot[a + b*x] + Sin[2*(a + b*x)])/(4*b)

________________________________________________________________________________________

Maple [A]  time = 0.012, size = 56, normalized size = 1.4 \begin{align*}{\frac{1}{b} \left ( -{\frac{ \left ( \cos \left ( bx+a \right ) \right ) ^{5}}{\sin \left ( bx+a \right ) }}- \left ( \left ( \cos \left ( bx+a \right ) \right ) ^{3}+{\frac{3\,\cos \left ( bx+a \right ) }{2}} \right ) \sin \left ( bx+a \right ) -{\frac{3\,bx}{2}}-{\frac{3\,a}{2}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x+a)^4/sin(b*x+a)^2,x)

[Out]

1/b*(-cos(b*x+a)^5/sin(b*x+a)-(cos(b*x+a)^3+3/2*cos(b*x+a))*sin(b*x+a)-3/2*b*x-3/2*a)

________________________________________________________________________________________

Maxima [A]  time = 1.48251, size = 58, normalized size = 1.45 \begin{align*} -\frac{3 \, b x + 3 \, a + \frac{3 \, \tan \left (b x + a\right )^{2} + 2}{\tan \left (b x + a\right )^{3} + \tan \left (b x + a\right )}}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)^4/sin(b*x+a)^2,x, algorithm="maxima")

[Out]

-1/2*(3*b*x + 3*a + (3*tan(b*x + a)^2 + 2)/(tan(b*x + a)^3 + tan(b*x + a)))/b

________________________________________________________________________________________

Fricas [A]  time = 1.82469, size = 104, normalized size = 2.6 \begin{align*} \frac{\cos \left (b x + a\right )^{3} - 3 \, b x \sin \left (b x + a\right ) - 3 \, \cos \left (b x + a\right )}{2 \, b \sin \left (b x + a\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)^4/sin(b*x+a)^2,x, algorithm="fricas")

[Out]

1/2*(cos(b*x + a)^3 - 3*b*x*sin(b*x + a) - 3*cos(b*x + a))/(b*sin(b*x + a))

________________________________________________________________________________________

Sympy [A]  time = 1.63634, size = 75, normalized size = 1.88 \begin{align*} \begin{cases} - \frac{3 x \sin ^{2}{\left (a + b x \right )}}{2} - \frac{3 x \cos ^{2}{\left (a + b x \right )}}{2} - \frac{3 \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{2 b} - \frac{\cos ^{3}{\left (a + b x \right )}}{b \sin{\left (a + b x \right )}} & \text{for}\: b \neq 0 \\\frac{x \cos ^{4}{\left (a \right )}}{\sin ^{2}{\left (a \right )}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)**4/sin(b*x+a)**2,x)

[Out]

Piecewise((-3*x*sin(a + b*x)**2/2 - 3*x*cos(a + b*x)**2/2 - 3*sin(a + b*x)*cos(a + b*x)/(2*b) - cos(a + b*x)**
3/(b*sin(a + b*x)), Ne(b, 0)), (x*cos(a)**4/sin(a)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.15988, size = 58, normalized size = 1.45 \begin{align*} -\frac{3 \, b x + 3 \, a + \frac{3 \, \tan \left (b x + a\right )^{2} + 2}{\tan \left (b x + a\right )^{3} + \tan \left (b x + a\right )}}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)^4/sin(b*x+a)^2,x, algorithm="giac")

[Out]

-1/2*(3*b*x + 3*a + (3*tan(b*x + a)^2 + 2)/(tan(b*x + a)^3 + tan(b*x + a)))/b